<?php
class upload extends skeleton {
	function get_date($format = 'F j, Y @ g:ia') {
		return get_date($format, $this->date, true);
	}
	
	function get_image($format = true, $options = array()) {
		$image = $url = get_option('site_path').'uploads/'.$this->url;
		
		if ($format === true) {
			$options = array_merge(array(
				'alt' => $image,
				'class' => '',
				'link' => false,
				'title' => 'View full size'
			), $options);
			
			$image = '<img src="'.$url.'" alt="'.$options['alt'].'" class="'.$options['class'].'" />';
			if ((bool)$options['link'] === true) $image = '<a href="'.$url.'" title="'.$options['title'].'">'.$image.'</a>';
		}
		
		return $image;
	}
	
	function the_date($format = 'F j, Y @ g:ia') {
		echo $this->get_date($format);
	}
	
	function the_image($format = true, $options = array()) {
		echo $this->get_image($format, $options);
	}
}
?>